/*
 * @Description: 我的道具
 * @Author: iamsmiling
 * @Date: 2021-05-30 21:40:13
 * @LastEditTime: 2021-05-30 22:01:59
 */
import 'package:credit_business_circle/R/R.dart';
import 'package:credit_business_circle/domain/local/prop/prop_kit_tab_entity.dart';
import 'package:flutter/material.dart';

class MinePropKitBody extends StatelessWidget {
  final List<PropEntity> props;
  const MinePropKitBody({Key? key, required this.props}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.symmetric(horizontal: R.dimen.dp12),
      child: Column(
        children: [
          Container(
            margin: EdgeInsets.only(
              top: R.dimen.dp22,
              bottom: R.dimen.dp11,
            ),
            child: Stack(
              alignment: AlignmentDirectional.center,
              children: [
                Image.asset(
                  R.image.mineVipBg,
                  width: R.dimen.width,
                  fit: BoxFit.fitWidth,
                ),
                Container(
                  padding: EdgeInsets.symmetric(horizontal: R.dimen.dp20),
                  child: Row(
                    children: [
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Text(
                            "会员卡",
                            style: TextStyle(
                                color: R.color.fff1e1a2,
                                fontSize: R.dimen.sp16,
                                fontWeight: FontWeight.w600),
                          ),
                          Container(
                            child: Text(
                              "开通VIP会员立享超值特权",
                              style: TextStyle(
                                  color: R.color.fffef1cf,
                                  fontSize: R.dimen.sp13),
                            ),
                          ),
                        ],
                      ),
                      Spacer(),
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.end,
                        children: [
                          Container(
                            padding: EdgeInsets.symmetric(
                                horizontal: R.dimen.dp20,
                                vertical: R.dimen.dp5),
                            decoration: BoxDecoration(
                                borderRadius:
                                    BorderRadius.circular(R.dimen.sp13),
                                gradient: LinearGradient(colors: [
                                  R.color.fffbefd0,
                                  R.color.fffae2a0
                                ])),
                            child: Text(
                              "续期",
                              style: TextStyle(
                                  color: R.color.ff56360e,
                                  fontSize: R.dimen.sp13),
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(top: R.dimen.dp2),
                            child: Text(
                              "有效期至：2020-06-15",
                              style: TextStyle(
                                  color: R.color.fffbefd0,
                                  fontSize: R.dimen.sp10),
                            ),
                          )
                        ],
                      )
                    ],
                  ),
                )
              ],
            ),
          ),
          Expanded(
              child: ListView.builder(
                  itemCount: props.length,
                  itemBuilder: (BuildContext context, int i) {
                    PropEntity item = props[i];
                    return Container(
                      padding: EdgeInsets.symmetric(
                          vertical: R.dimen.dp16, horizontal: R.dimen.dp20),
                      margin: EdgeInsets.only(top: R.dimen.dp10),
                      decoration: BoxDecoration(
                          color: R.color.ffffffff,
                          borderRadius: BorderRadius.circular(R.dimen.sp8)),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              Text(
                                item.label,
                                style: TextStyle(
                                    color: R.color.ff111111,
                                    fontSize: R.dimen.sp16,
                                    fontWeight: FontWeight.w600),
                              ),
                              Container(
                                  margin: EdgeInsets.only(top: R.dimen.dp10),
                                  child: Text(
                                    item.description,
                                    style: TextStyle(
                                        fontSize: R.dimen.sp12,
                                        color: R.color.ff222222),
                                  ))
                            ],
                          ),
                          Text(
                            "数量：X${item.count}",
                            style: TextStyle(
                                fontSize: R.dimen.sp13,
                                color: R.color.ff111111),
                          )
                        ],
                      ),
                    );
                  }))
        ],
      ),
    );
  }
}
